﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DBHelper;
using BusinessLayer.FindArtInfo.Entities;
using System.Data.SqlClient;
using System.Data;
using BusinessLayer.FindArtInfo.Models;

namespace BusinessLayer.FindArtInfo
{
    public class ArtistLinkBL
    {
        private readonly DbHelper _db;

        public ArtistLinkBL()
        {
            _db = new DbHelper(new DbConfig().DbFindArtInfoConnectionString);         
        }

        public List<ArtistLinkModel> GetByArtistId(int artistId)
        {
            var oCommand = new SqlCommand("sp_ArtistLink_Select_By_ArtistId") { CommandType = CommandType.StoredProcedure };
            oCommand.Parameters.Add(new SqlParameter("@ArtistId", artistId));
            var list = _db.GetList<ArtistLinkModel>(oCommand);
            return list; 
        }
    }
}
